package com.java1412.config;

import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author java1412
 * @create 2021-05-13 16:25
 */
// @Configuration
public class MyWebMvcConfig extends WebMvcConfigurationSupport {
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 将所有D：/resources/目录下的资源，访问时都映射到/res/**路径下
        registry.addResourceHandler("/res/**")
                .addResourceLocations("classpath:/META-INF/resources/", "classpath:/resources/",
                        "classpath:/static/", "classpath:/public/", "file:D:/resources/");
    }
}
